﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Fuse8.ContentManagementFramework.Domain
{
    public partial class CmsWorkflow
    {
        public virtual CmsWorkflowHistory LatestWorkflowState
        {
            get
            {
                return WorkflowHistory != null ?
                    WorkflowHistory.FirstOrDefault(p => p.IsLatestState) :
                    null;
            }
        }

        public virtual IEnumerable<CmsWorkflowHistory> WorkflowHistory { get; set; }
    }
}
